package net.sareweb.acab.entity.manager;

import java.util.List;

import javax.persistence.Query;

import net.sareweb.acab.entity.Commentonsuggestion;
import net.sareweb.acab.entity.Request;
import net.sareweb.acab.entity.Suggestion;
import net.sareweb.acab.entity.User;


import org.jboss.seam.ScopeType;
import org.jboss.seam.annotations.Name;
import org.jboss.seam.annotations.Scope;

@Name("commentOnSuggestionManager")
@Scope(ScopeType.CONVERSATION)
public class CommentOnSuggestionManager extends CommonManager<Commentonsuggestion> {
	private static final String suggestionInfoComments = "select * from Commentonsuggestion commentonsuggestion where suggestionInfo=? order by commentonsuggestion.createDate desc";

	public List<Commentonsuggestion> getSuggestionComments(int idSuggestion){
		Query q = entityManager.createNativeQuery(suggestionInfoComments, Commentonsuggestion.class);
		q.setParameter(1, idSuggestion);	
		return q.getResultList();
	}
}
